/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package ru.ibrae.mchs.radiation.entities;

import java.io.Serializable;
import java.util.Set;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Lob;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;

/**
 *
 * @author murr
 */
@Entity
@Table(name = "dicist", uniqueConstraints = {
    @UniqueConstraint(columnNames = {"ID_IST"})})
@NamedQueries({
    @NamedQuery(name = "DicIst.findAll", query = "SELECT d FROM DicIst d"),
    @NamedQuery(name = "DicIst.findByIdIst", query = "SELECT d FROM DicIst d WHERE d.idIst = :idIst"),
    @NamedQuery(name = "DicIst.findByName", query = "SELECT d FROM DicIst d WHERE d.name = :name")})
public class DicIst implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "ID_IST", nullable = false)
    private Integer idIst;
    @Basic(optional = false)
    @Column(name = "NAME", nullable = false, length = 195)
    private String name;
    @Lob
    @Column(name = "TITUL", length = 16777215)
    private String titul;
    @OneToMany(mappedBy = "dicIst")
    private Set<Result> resultSet;
    @OneToMany(mappedBy = "dicIst")
    private Set<CrossZon> crossZonSet;

    public DicIst() {
    }

    public DicIst(Integer idIst) {
        this.idIst = idIst;
    }

    public DicIst(Integer idIst, String name) {
        this.idIst = idIst;
        this.name = name;
    }

    public Integer getIdIst() {
        return idIst;
    }

    public void setIdIst(Integer idIst) {
        this.idIst = idIst;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getTitul() {
        return titul;
    }

    public void setTitul(String titul) {
        this.titul = titul;
    }

    public Set<Result> getResultSet() {
        return resultSet;
    }

    public void setResultSet(Set<Result> resultSet) {
        this.resultSet = resultSet;
    }

    public Set<CrossZon> getCrossZonSet() {
        return crossZonSet;
    }

    public void setCrossZonSet(Set<CrossZon> crossZonSet) {
        this.crossZonSet = crossZonSet;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idIst != null ? idIst.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof DicIst)) {
            return false;
        }
        DicIst other = (DicIst) object;
        if ((this.idIst == null && other.idIst != null) || (this.idIst != null && !this.idIst.equals(other.idIst))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "JPAtest.entities.DicIst[idIst=" + idIst + "]";
    }

}
